package com.acme.bankapp.domain.bank;

import java.util.ArrayList;

import com.acme.bankapp.service.bank.BankApplication;

/**
 * Class which represents typical Bank
 * 
 * @author render1980
 *
 */
public class Bank extends BankApplication {
	/**
	 * List which contains bank clients
	 */
	private ArrayList<Client> clients = null;
	
	public Bank() {
		this.clients = new ArrayList<Client>();
	}
	
	/**
	 * Method to get all bank clients
	 * 
	 * @return	all clients of current bank
	 */
	public Client[] getClients() { 
		return this.clients.toArray(new Client[clients.size()]);
	}
	
	/**
	 * Method to add client to Bank.clients list
	 * 
	 * @param client	client to be added to the clients list
	 */
	public void addClient(Client client) {
		this.clients.add(client);
	}
	
	/**
	 * Method which removes client
	 * 
	 * @param client	client to be removed from the clients list
	 */
	public void removeClient(Client client) {
		int index = this.clients.indexOf(client);
		this.clients.remove(index);
	}
}
